package com.yaglyf.mvc.service.impl;

import com.yaglyf.mvc.aop.annotation.ExceptionHandler;
import com.yaglyf.mvc.controller.vo.User;
import com.yaglyf.mvc.emun.UserEnum;
import com.yaglyf.mvc.service.core.intf.IUserInfoService;
import com.yaglyf.mvc.service.dto.UserDto;
import com.yaglyf.mvc.service.itf.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Title: Class CommentsShow
 * Description:
 * 注释展示类，说明各种方法注释怎么写
 *
 * @author qiang.yang
 * @version 1.0.0
 * @email qiang.yang@chinaredstar.com
 * @date: 2016/10/14 15:00
 */
@Service
@ExceptionHandler
public class LoginService implements ILoginService{
    @Autowired
    private IUserInfoService userInfoService;

    @Override
    public UserDto login(User user) {
        if (null == user){
            return new UserDto(UserEnum.LOGIN_ERR);
        }
        return userInfoService.hasUser(user);
    }
}
